package com.jack006.user.stream;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * @Classname MyStreamConsumer
 * @Description 构建消费端
 * @Date 2021-08-12 08:44
 * @Created by jack
 */
@Component
@EnableBinding(MyStreamChannel.class)
public class MyStreamConsumer {


    /**
     * 监听并且实现消费的消费和相关业务处理
     */
//    @StreamListener(MyStreamChannel.INPUT)
//    public void receiveMsg(AppUser appUser) {
//        System.out.println(appUser.getId()+":"+appUser.getNickname());
//    }

    @StreamListener(MyStreamChannel.INPUT)
    public void receiveMsg(String dumpling) {
        System.out.println(dumpling);
    }

}
